﻿//-----------------------------------------------------------------------
// <copyright file="Copyright.cs" author="Michael Herndon">
//     Copyright (c) CompanyName.  All rights reserved.
// </copyright>
//-----------------------------------------------------------------------

namespace Amplify.Twitter
{
	#region Using Statements
	using System;
	using System.Collections.Generic;
	using System.Linq;
	using System.Text;

	using MbUnit.Framework;

	using Describe = MbUnit.Framework.TestsOnAttribute;
	using InContext = MbUnit.Framework.DescriptionAttribute;
	using It = MbUnit.Framework.TestAttribute;
	using Should = MbUnit.Framework.DescriptionAttribute;
	using By = MbUnit.Framework.AuthorAttribute;
	using Tag = MbUnit.Framework.CategoryAttribute;
	#endregion

	[
		Describe(typeof(DirectMessageClient)),
		InContext("should perform its specified behavor."),
		Tag("Functional"),
		Ignore,
		By("Michael Herndon", "mherndon@opensourceconnections.com", "www.amptools.net")
	]
	public class DirectMessageClientSpec : Spec
	{

		[It, Should(" have a public default constructor. ")]
		public void CreateListAndDestory() 
		{
			UserClient userClient = Twitter.CreateUserClient();
			User[] victims = userClient.GetFriends();
			victims.ShouldNotBeNull();
			victims.Length.ShouldBeGreaterThan(0);

			User victim = victims[0];

			DirectMessageClient client = Twitter.CreateDirectMessageClient();

			DirectMessage tweet = client.Create(victim.Screename, "This is a test message");

			DirectMessage[] sentMessages =	client.GetSentList();

			sentMessages.ShouldNotBeNull();
			sentMessages.Length.ShouldBeGreaterThan(0);


			DirectMessage[] messages = client.GetList();
			messages.ShouldNotBeNull();
			messages.Length.ShouldBeGreaterThan(0);

			//can only test if you someone has sent you a DirectMessage
			//client.Destroy(tweet.Id.Value);
			
		}
	}
}
